<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>邀请监护人</title>
		<script src="../js/mui.min.js"></script>
		<link href="../css/mui.min.css" rel="stylesheet" />
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">邀请监护人</h1>
		</header>
		<div class="mui-content">
			<p style="margin-top:20px;margin-left: 20px;">通过配对码邀请监护人</p>
			
			<div class="mui-content-padded">
				<div class="mui-input-row">
					<label>配对码</label>
					<input type="text" class="mui-input-clear" id="pairCodeArea" placeholder="配对码区域">
				</div>
			</div>
			
			<div class="mui-button-row">
				<button type="button" onclick="copyPairCode();" class="mui-btn mui-btn-primary" >一键复制</button>
			</div>
			
			<div style="height:44px;"></div>
			
		</div>

		<script>
			mui.init();
			
			var pairCode = localStorage.getItem('pairCode');
			document.getElementById('pairCodeArea').value = pairCode;
			
			function copyPairCode(){
				var oInput = document.createElement('input');
				oInput.value = pairCode;
				document.body.appendChild(oInput);
				oInput.select(); // 选择对象
				try {
					document.execCommand('copy');
					mui.toast('复制成功');
				}catch (err) {
					mui.toast('请使用CTRL+C来复制');
				}
				oInput.className = 'oInput';
				oInput.style.display='none';
			}
			
			

		</script>
	</body>
</html>
